package what.the.fun.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import what.the.fun.domain.User;

public class UserExtractor implements ResultSetExtractor<User> {

 public User extractData(ResultSet resultSet) throws SQLException
  	, DataAccessException {
  
  User user = new User();
  
  user.setUserId(resultSet.getString(1));
  user.setName(resultSet.getString(2));
  user.setPassword(resultSet.getString(3));
  
  return user;
 }

}

